<%@ page import="java.util.Map" %>
<%@ page import="java.util.List" %>
<%@ page import="com.hotel.entity.BookidDetail" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript" src="../js/calendar.js"></script>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/hotel/style/style.css" />
    <style type="text/css">
        div.heading{
            border-bottom:solid 1px #000000;
            border-top:solid 1px #ffffff;
            margin-bottom:10px;
        }

        div.heading p{
            padding:0;
            margin-bottom:10px;
            text-align:center;
        }

        div.submit{
            text-align:center;
            margin-top: 15px;
            border: solid 1px #ffffff;
        }

        fieldset{
            position:relative;
            width:450px;
            margin:auto;
            margin-top:20px;
        }

        fieldset select{
            width:120px;
        }

        fieldset input{
            width:120px;
        }

        div.row{
            position: relative;
            padding:8px 0;
            margin-bottom:10px;
        }

        div.column1{
            width:25%;
            position:relative;
            float: left;
            margin: 0;
        }

        div.column2{
            width:25%;
            margin: 0;
            float:left;
        }

        div.column3{
            width:25%;
            margin: 0;
            float:left;
        }

        div.column4{
            margin-left:675px;
            width:180px;
        }



        .column_2 span{
            border-bottom: dashed 1px #000000;
        }

        table{
            margin:auto;
            margin-top:20px;
            width:700px;
            border-collapse:collapse;
        }

        th,td{
            border:solid 1px #000000;
            padding:6px 1px;
        }

        .index{
            width: 50px;
            text-align:center;
        }

        .book{
            text-align:center;
        }

        .date{
            text-align:center;
        }

        .opt{
            text-align:center;
        }

        td div{
            text-align: center;
            margin: 0;
            padding: 0;
        }

        .text{
            width:390px;
        }

    </style>
    <title>查询明细信息</title>
</head>
<body>
<div id="container">
    <div id="header">
        <ul>
            <li>
                <a href="<%=request.getContextPath()%>/hotel/manager/login.jsp"
                   onclick="return confirm('确定要退出登录吗？');">退出</a>
            </li>

        </ul>
    </div>
    <div id="menu">
        <ul>
            <li><a href="<%=request.getContextPath()%>/hotel/manager/bookQuery.jsp">客房管理</a></li>
            <li><a href="<%=request.getContextPath()%>/hotel/manager/memberQuery.jsp">会员管理</a></li>
            <li><a href="<%=request.getContextPath()%>/hotel/manager/subscriptionQuery.jsp">订单管理</a></li>
        </ul>
    </div>
    <div id="content">
        <h3>订单号: <%= request.getAttribute("orderNo") %></h3>
        <p>创建时间: <%= request.getAttribute("regtime") %></p>
        <p>会员名: <%= request.getAttribute("username") %></p>
        <p>联系人: <%= request.getAttribute("linkman") %></p>
        <p>联系电话: <%= request.getAttribute("phone") %></p>
        <p>电子邮件: <%= request.getAttribute("email") %></p>
        <p>订单状态: <%= request.getAttribute("status") %></p>

        <form action="<%=request.getContextPath()%>/UpdateOrderStatusServlet.member" method="post">
            <input type="hidden" name="orderNo" value="<%= request.getAttribute("orderNo") %>">
            <label><input type="radio" name="status" value="0"> 取消</label>
            <label><input type="radio" name="status" value="1"> 确认</label>
            <label><input type="radio" name="status" value="2"> 未确认</label>
            <br>
            <input type="submit" value="更新状态">
        </form>
    </div>

    <h1>订单明细信息管理</h1>
    <table>
        <tr>
            <th>书名</th>
            <th>编号</th>
            <th>借书日期</th>
            <th>还书日期</th>
            <th>操作</th>
        </tr>
        <%
            List<BookidDetail> bookidDetails = (List<BookidDetail>) request.getAttribute("bookidDetails");
            if (bookidDetails != null && !bookidDetails.isEmpty()) {
                for (BookidDetail detail : bookidDetails) {
        %>
        <tr>
            <td><%= detail.getBookidType() %></td>
            <td><a href="<%=request.getContextPath()%>/viewResideDetails.member?bookidNo=<%= detail.getBookidNo() %>"><%= detail.getBookidNo() %></a></td>
            <td><%= detail.getStartDate() %></td>
            <td><%= detail.getEndDate() %></td>
            <td>
                <div>
                    <a href="<%=request.getContextPath()%>/deleteSubscriptionDetail2.member?id=<%= detail.getId() %>&no=<%= detail.getBookidNo() %>"
                       onclick="return confirm('真的要删除该预定细信息吗？')">删除</a>
                    <a href="<%=request.getContextPath()%>/hotel/manager/resideAdd.jsp?bookidNo=<%=detail.getBookidNo()%>&startDate=<%=detail.getStartDate()%>&no=<%= request.getAttribute("orderNo") %>">借书办理</a>
                </div>
            </td>
        </tr>
        <%
            }
        } else {
        %>
        <tr>
            <td colspan="7" style="text-align:center;">暂无借书明细信息</td>
        </tr>
        <%
            }
        %>
    </table>

    <div>
        <input type="button" value="返回" onclick="location='<%=request.getContextPath()%>/hotel/manager/subscriptionQuery.jsp'" />
    </div>
    <hr />
    <div id="footer">
        <p>本系统做为Java Web教学设计使用。未经允许，不得做为它用，版权所有Allan<br />联系方式：javamedia@live.cn</p>
    </div>
</div>
</body>
</html>
